package org.zxw.cms.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;
import org.zxw.basic.dao.impl.BaseDaoImpl;
import org.zxw.basic.model.Pager;
import org.zxw.cms.dao.IGroupDao;
import org.zxw.cms.model.Group;

@Repository("groupDao")
public class GroupDaoImpl extends BaseDaoImpl<Group> implements IGroupDao {

	@Override
	public List<Group> listGroup() {
		return this.list("from Group");
	}

	@Override
	public Pager<Group> findGroup() {
		return this.find("from Group");
	}

	@Override
	public void deleteGroupUsers(int groupId) {
		String hql = "delete UserGroup ug where ug.group.id=?";
		this.updateByHql(hql, groupId);
	}

}
